package kr.hkit.powerjava.chapter12.poly;

public class ShapeMain {
	public static void main(String[] args) {
		Shape[] arrShape = new Shape[6];
		arrShape[0] = new Ellipse(5);
		arrShape[1] = new Rectangle(4,5);
		arrShape[2] = new Triangle(5,6);
		arrShape[3] = new Shpere(6);
		arrShape[4] = new Cube(4,3,9);
		arrShape[5] = new Cylinder(6,7);
		
		for(int i = 0; i<arrShape.length; i++){
			if(arrShape[i] instanceof TwoDimshape){
				arrShape[i].getArea();
			}else{
				arrShape[i].getVolume();
			}
		}
/*		System.out.println("obj is of type : " + arrShape[0].getClass().getName());
		System.out.println(" Type : " + arrShape[0].getClass().getCanonicalName());*/
	}
}

